/*
 * @Description: 宠物属性管理
 * @Author: 龙春雨
 * @Date: 2023-04-06 14:07:24
 */
// import { rule } from '@/util/validateRules';
export const tableOption = {
  ...window.$crudMixins.tableOptions,
  viewBtn: false,
  addBtn: true,
  editBtn: true,
  delBtn: true,
  labelWidth: 100,
  searchLabelWidth: 90,
  dialogCustomClass: 'dialog-classify',
  span: 24,
  menuWidth: 160,
  column: [
    {
      label: '宠物类型',
      prop: 'classifyCode',
      row: true,
      fixed: true,
      span: 12,
      hide: true,
      disabled: true,
    },
    {
      label: '宠物属性',
      prop: 'attributeCode',
      row: true,
      span: 12,
      type: 'select',
      search: true,
      searchType: 'input',
      searchProp: 'attributeName',
      dicUrl: '/core/attribute/list/0',
      props: {
        label: 'attributeName',
        value: 'attributeCode',
      },
      editDisabled: true,
      rules: [
        {
          required: true,
          message: '请选择宠物属性！',
          trigger: 'blur',
        },
      ],
    },
    {
      label: '说明',
      prop: 'remark',
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
    },
    {
      label: '排序',
      prop: 'sort',
      type: 'number',
      value: 1,
      precision: 0,
      min: 0,
      max: 100,
      width: 100,
      rules: [
        {
          required: true,
          message: '请输入排序',
          trigger: 'blur',
        },
        {
          pattern: /^[0-9]*[1-9][0-9]*$/,
          message: '排序只能输入正整数',
        },
      ],
      row: true,
      span: 6,
    },
    {
      label: '创建时间',
      prop: 'createTime',
      width: 150,
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
    },
  ],
  group: [
    {
      label: '说明',
      prop: 'remarkGroup',
      arrow: false,
      labelWidth: 0,
      column: [
        {
          placeholder: '请输入宠物属性说明',
          prop: 'remark',
          type: 'textarea',
          maxlength: 100,
          minRows: 7,
          showWordLimit: true,
        },
      ],
    },
  ],
};
